﻿#include "CmdWaveButterANdFFT.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"
#include "BaseModule/GlobalHelper.h"

namespace PostCommand
{
    CmdWaveButterANdFFT::CmdWaveButterANdFFT()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdWaveButterANdFFT::~CmdWaveButterANdFFT()
    {
    }

    bool CmdWaveButterANdFFT::execute()
    {
        QList<double> resultList1 = GlobalHelperInstance->convertStringToDoubleList(m_result);
        emit IBaseSignalInstance->signal_sentWaveButterANdFFTVResult(m_windowId, resultList1);
        return true;
    }

    void CmdWaveButterANdFFT::undo()
    {
        //QFile::remove(m_filePath);
    }

    void CmdWaveButterANdFFT::redo()
    {
        //execute();
    }

    void CmdWaveButterANdFFT::setResult(int windowId, const QString& result)
    {
        m_windowId = windowId;
        m_result = result;
    }

}
